package com.zhijian.medical.entity.vo.response;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * 产品表 回显vo
 *
 * @author HCG
 * @version 1.0
 * @date 2022-01-17 14:55:39
 */
@Api(tags = "产品表回显vo")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductVo implements Serializable {

    private static final long serialVersionUID = -1;

    /**
     * 主键id
     */
    @ApiModelProperty("主键id")
    private Long id;

    /**
     * 名称
     */
    @ApiModelProperty("名称")
    private String name;

    /**
     * 编号
     */
    @ApiModelProperty("编号")
    private String number;

    /**
     * 品牌
     */
    @ApiModelProperty("品牌")
    private String brand;

    /**
     * 厂家名称
     */
    @ApiModelProperty("厂家名称")
    private String factory;

    /**
     * 厂家id
     */
    @ApiModelProperty("厂家id")
    private Long factoryId;

    /**
     * 数量
     */
    @ApiModelProperty("数量")
    private Integer quantity;

    /**
     * 申请人id
     */
    @ApiModelProperty("申请人id")
    private Long applyUserId;

    /**
     * 申请人名称
     */
    @ApiModelProperty("申请人名称")
    private String applyUserName;

    /**
     * 审批人id
     */
    @ApiModelProperty("审批人id")
    private Long approveUserId;

    /**
     * 审批人名称
     */
    @ApiModelProperty("审批人名称")
    private String approveUserName;

    /**
     * 申请人组织id集合，以英文逗号隔开
     */
    @ApiModelProperty(value = "申请人组织id集合，以英文逗号隔开", hidden = true)
    private String applyUserGroupIds;

    /**
     * 试剂品类id
     */
    @ApiModelProperty("试剂品类id")
    private Long agentiaCategoryId;

    /**
     * 状态，0：等待审批，1：审批完毕，2：发货中，3：收获完毕
     */
    @ApiModelProperty("状态，0：等待审批，1：审批完毕，2：发货中，3：收获完毕")
    private Byte status;

    /**
     * 状态字符串
     */
    @ApiModelProperty("状态字符串")
    private String statusStr;

    /**
     * 申购号
     */
    @ApiModelProperty("申购号")
    private String code;

    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String note;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private String createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty("修改时间")
    private String updateTime;

    /**
     * 已发货数量
     */
    @ApiModelProperty("已发货数量")
    private Integer alreadySendOutCount;

    /**
     * 未发货数量
     */
    @ApiModelProperty("未发货数量")
    private Integer unSendOutCount;

    /**
     * 厂家是否需要使用智能化平台
     */
    @ApiModelProperty("厂家是否需要使用智能化平台，0：是，1：否")
    private Byte weatherUsePlatform;

    public Byte getWeatherUsePlatform() {
        return weatherUsePlatform;
    }

    public void setWeatherUsePlatform(Byte weatherUsePlatform) {
        this.weatherUsePlatform = weatherUsePlatform;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getFactory() {
        return factory;
    }

    public void setFactory(String factory) {
        this.factory = factory;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Long getApplyUserId() {
        return applyUserId;
    }

    public void setApplyUserId(Long applyUserId) {
        this.applyUserId = applyUserId;
    }

    public String getApplyUserName() {
        return applyUserName;
    }

    public void setApplyUserName(String applyUserName) {
        this.applyUserName = applyUserName;
    }

    public Long getApproveUserId() {
        return approveUserId;
    }

    public void setApproveUserId(Long approveUserId) {
        this.approveUserId = approveUserId;
    }

    public String getApproveUserName() {
        return approveUserName;
    }

    public void setApproveUserName(String approveUserName) {
        this.approveUserName = approveUserName;
    }

    public String getApplyUserGroupIds() {
        return applyUserGroupIds;
    }

    public void setApplyUserGroupIds(String applyUserGroupIds) {
        this.applyUserGroupIds = applyUserGroupIds;
    }

    public Long getAgentiaCategoryId() {
        return agentiaCategoryId;
    }

    public void setAgentiaCategoryId(Long agentiaCategoryId) {
        this.agentiaCategoryId = agentiaCategoryId;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getStatusStr() {
        return statusStr;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getAlreadySendOutCount() {
        return alreadySendOutCount;
    }

    public void setAlreadySendOutCount(Integer alreadySendOutCount) {
        this.alreadySendOutCount = alreadySendOutCount;
    }

    public Integer getUnSendOutCount() {
        return unSendOutCount;
    }

    public void setUnSendOutCount(Integer unSendOutCount) {
        if (Objects.isNull(this.quantity)) {
            this.unSendOutCount = null;
            return;
        }
        if (Objects.isNull(this.alreadySendOutCount)) {
            this.unSendOutCount = this.quantity;
            return;
        }
        int result = this.quantity - this.alreadySendOutCount;
        if (result < 0) {
            result = 0;
        }
        this.unSendOutCount = result;
    }

    public Long getFactoryId() {
        return factoryId;
    }

    public void setFactoryId(Long factoryId) {
        this.factoryId = factoryId;
    }
}